﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace app.Api
{
    public class ModelBase
    {
        private ApiBase _base = null;
        protected ApiBase api_base {
            get {
                //if(_base == null)
                //{
                    _base = (ApiBase)HttpContext.Current.Session["base"];
                //}
                return _base;
            }
        }

        public bool HasPermission(PermissionOperation operation)
        {
            return Permission.Check(api_base.UserPermission, operation.GetCode());
        }
    }
}